import Home from '@/auth/pages/Home'

export default {
  path: '/organization',
  name: 'organization',
  meta: {
    icon: 'logo-chrome',
    title: '机构管理'
  },
  component: Home,
  children: [
    {
      path: 'enterprise-info',
      name: 'enterprise-info',
      meta: {
        title: '公司机构'
      },
      component: () => import('@/views/organization/CompanyOrganization.vue')
    },
    {
      path: 'add-company-add/:name/:id/:type/:objectId/:parentId/:parentName',
      name: 'company-add',
      meta: {
        title:'新增公司',
        notCache: false
      },
      component: () => import('@/views/organization/CompanyAdd/company-add')
    },
    {
      path: 'add-company-edit/:name/:id/:type/:objectId/:parentId/:parentName',
      name: 'company-edit',
      meta: {
        title:'公司编辑',
        notCache: false
      },
      component: () => import('@/views/organization/CompanyAdd/company-edit')
    },
    {
      path: 'add-company/:name/:id/:type/:objectId/:parentId/:parentName',
      name: 'company-detail',
      meta: {
        title:'公司详情',
        notCache: true
      },
      component: () => import('@/views/organization/CompanyAdd/company-detail')
    },
    {
      path: 'add-area-add/:name/:id/:type/:objectId/:parentId/:parentName',
      name: 'area-add',
      meta: {
        title: '新增区域',
        notCache: false
      },
      component: () => import('@/views/organization/CompanyAdd/area/area-add')
    },
    {
      path: 'add-area-edit/:name/:id/:type/:objectId/:parentId/:parentName',
      name: 'area-edit',
      meta: {
        title: '区域编辑',
        notCache: false
      },
      component: () => import('@/views/organization/CompanyAdd/area/area-edit')
    },
    {
      path: 'add-area/:name/:id/:type/:objectId/:parentId/:parentName',
      name: 'area-detail',
      meta: {
        title: '区域详情',
        notCache: false
      },
      component: () => import('@/views/organization/CompanyAdd/area/area-detail')
    },
    {
      path: 'add-department-add/:name/:id/:type/:objectId/:parentId/:parentName',
      name: 'department-add',
      meta: {
        title: '新增部门',
        notCache: false
      },
      component: () => import('@/views/organization/CompanyAdd/department/department-add')
    },
    {
      path: 'add-department-edit/:name/:id/:type/:objectId/:parentId/:parentName',
      name: 'department-edit',
      meta: {
        title: '部门编辑',
        notCache: false
      },
      component: () => import('@/views/organization/CompanyAdd/department/department-edit')
    },
    {
      path: 'add-department/:name/:id/:type/:objectId/:parentId/:parentName',
      name: 'department-detail',
      meta: {
        title: '部门详情',
        notCache: false
      },
      component: () => import('@/views/organization/CompanyAdd/department/department-detail')
    },
    {
      path: 'enterprise-person',
      name: 'enterprise-person',
      meta: {
        title: '公司人员'
      },
      component: () => import('@/views/organization/CompanyPerson/CompanyStaff.vue')
    },
    //现有人员选择
    {
      path: 'enterprise-check-person/:name',
      name: 'enterprise-check-person',
      meta: {
        title: route => `${route.params.name}`
      },
      component: () =>
        import('@/views/organization/CompanyPerson/CheckPerson.vue')
    },
    //项目人员新增
    {
      path: 'enterprise-person-add/:type/:deptId/:name',
      name: 'enterprise-person-add',
      meta: {
        title: `机构人员新增`
      },
      props: true,
      component: () => import('@/views/organization/CompanyPerson/add.vue')
    },
    //项目人员编辑
    {
      path: 'enterprise-person-edit/:type/:deptId/:id/:name',
      name: 'enterprise-person-edit',
      meta: {
        title: route => `${route.params.name}`
      },
      component: () =>
        import(
          '@/views/organization/CompanyPerson/edit.vue'
          )
    },
    //项目人员编辑
    {
      path: 'enterprise-person/:type/:id/:name',
      name: 'enterprise-person-detail',
      meta: {
        title: route => `${route.params.name}`
      },
      component: () =>
        import(
          '@/views/organization/CompanyPerson/detail.vue'
          )
    },
  ]
}
